It is common for software and web sites to present the user with an image, such as a map of the United States, and to allow the user to select a region of the image, such as a particular state, by clicking on the image region. In response, the software or web site may perform an action related to the selected region, such as displaying additional information about the state illustrated by the selected region.
Such functionality is often provided using an “image map,” which defines an outline of each of the regions within the image which may be selected by the user. In the example above, the image map would include, for each state, a set of coordinates defining the vertices of a polygon which form the outline of the state. Each such polygon defines a “hotspot” within the image which may be selected by the user to select the corresponding state. Associated with each hotspot may be instructions defining the action to be taken in response to the user's selection of the hotspot. Such instructions may, for example, take the form of a hyperlink to a location containing more information about the corresponding state.
The intent of an image map is to enable multiple regions (hotspots) within a single image to be linkable to different locations (or to trigger other actions) without requiring the image to be divided into separate image files. This simplifies the process of creating user-friendly web pages containing multiple hotspots within a single image.
Existing languages for defining web pages, such as HTML and XHTML, contain mechanisms for implementing image maps in the manner described above. Existing techniques for creating an image map containing multiple hotspots, however, tend to be tedious, time-consuming, and prone to error. For example, it is possible to create an image map by writing the necessary HTML code manually using a text editor, but defining each vertex of each hotspot in an image is a painstaking process. As a result, most image maps which are created by hand-coding tend to consist of hotspots which are simple polygons, such as rectangles and trapezoids, and which therefore may not correspond very accurately to the image regions they are intended to overlap. Consider, for example, attempting to code by hand a hotspot for an irregularly-shaped state such as Florida using only simple polygons.
As a result, software tools exist which facilitate the process of creating image maps by drawing hotspots within them. Although such tools represent an improvement over hand-coding, the process of creating a polygon that forms the precise outline of an irregular shape can still be tedious, time-consuming, and error prone. Creating a large number of such hotspots within a single image can be particularly time-consuming. As a result, users are still often faced with image maps containing hotspots that only roughly correspond to the image regions they are intended to represent.
What is needed, therefore, are improved techniques for implementing hotspots in web pages and in software more generally.